<script setup>
import { appStockListQuery } from "@/services/cashier";
import { onLoad, onReady, onShow } from "@dcloudio/uni-app";
import { nextTick, ref, watch, onMounted } from "vue";
import { appInfo, loginSwitch } from "@/services/user";
const topHeight = ref(uni.getStorageSync("topHight") || 0);
onLoad((e) => {});
onReady(() => {
  // 微信小程序需要用此写法
  // datetimePickerRef.value.setFormatter(formatter);
});
const selectShow = ref(false);
function open() {
  // 打开逻辑，比如设置 show 为 true
  // selectShow.value = true;
  // console.log('open');
}

const list1 = ref([{ name: "收入" }, { name: "支出" }]);
const rules = ref({
  userInfo: {
    type: "string",
    required: true,
    message: "请填写姓名",
    trigger: ["blur", "change"],
  },
  userInfo: {
    type: "string",
    max: 1,
    required: true,
    message: "请选择男或女",
    trigger: ["blur", "change"],
  },
});
const form = ref({});
const showSex = ref(false);
</script>

<template>
  <view class="bg">
    <top-nav :title="'搜索单据'" :border="true" rType="save"></top-nav>

    <view class="top" :style="'top: calc( 88rpx + ' + topHeight + 'px);'">
      <up-tabs :list="list1" :activeStyle="{ color: '#1679FB' }" keyName="name">
      </up-tabs>
    </view>
    <view class="content">
      <view class="content-k">
        <!-- 注意，如果需要兼容微信小程序，最好通过setRules方法设置rules规则 -->
        <up-form labelPosition="left" :model="form" :rules="rules" ref="form1">
          <up-form-item
            :required="true"
            label="金额"
            prop="salePrice"
            :borderBottom="true"
            ref="item1"
            labelWidth="180rpx"
          >
            <up-input
              type="digit"
              v-model="form.salePrice"
              border="none"
              placeholder="请填写金额"
            ></up-input>
          </up-form-item>
          <up-form-item
            label="项目"
            prop="sex"
            :borderBottom="true"
            @click="showSex = true"
            ref="item1"
            :required="true"
          >
            <view class="select isselect"
              >说了实打实<up-icon
                name="arrow-right"
                color="#303133"
                size="24rpx"
              ></up-icon
            ></view>
          </up-form-item>
          <up-form-item
            label="支付方式"
            prop="sex"
            :borderBottom="true"
            @click="showSex = true"
            ref="item1"
            :required="true"
          >
            <view class="select isselect"
              >说了实打实<up-icon
                name="arrow-right"
                color="#303133"
                size="24rpx"
              ></up-icon
            ></view>
          </up-form-item>
          <up-form-item
            :required="true"
            label="打印"
            prop="salePrice"
            :borderBottom="true"
            ref="item1"
            labelWidth="180rpx"
          >
            <up-input
              type="number"
              v-model="form.salePrice"
              border="none"
              placeholder="请填写"
            ></up-input>
          </up-form-item>
          <up-form-item
            :required="true"
            label="备注"
            prop="salePrice"
            :borderBottom="true"
            ref="item1"
            labelWidth="180rpx"
          >
            <up-input
              v-model="form.salePrice"
              border="none"
              placeholder="请填写"
            ></up-input>
          </up-form-item>
        </up-form>

        <!-- <view class="line_in"></view> -->

        <up-action-sheet
          :show="showSex"
          :actions="actions"
          title="请选择性别"
          description="如果选择保密会报错"
          @close="showSex = false"
          @select="sexSelect"
        >
        </up-action-sheet>
      </view>
      <view class="up">
        <up-button type="primary" text="确定"></up-button>
      </view>
    </view>
  </view>
</template>

<style lang="scss" scoped>
@import "index.scss";
</style>
